package v1

import (
	"github.com/gogf/gf/v2/frame/g"
	"github.com/gogf/gf/v2/os/gtime"
	"wh-1-backend/internal/model/entity"
)

type GetCompanyPageListReq struct {
	g.Meta `path:"/companies" tags:"Company" method:"get" summary:"公司列表"`
	Title  string `json:"title" v:"length:1,20"`
	PageCommonReq
}

type SimpleCompanyList struct {
	Id         uint        `json:"id"               `      //
	Title      string      `json:"title"            `      //
	Address    string      `json:"address"            `    //
	IndustryId uint        `json:"industryId"            ` //
	Industry   interface{} `json:"industry"`
	CreatedAt  *gtime.Time `json:"createdAt"        ` //
	UpdatedAt  *gtime.Time `json:"updatedAt"        ` //
	DeletedAt  *gtime.Time `json:"deletedAt"        ` //
}

type GetCompanyPageListRes struct {
	Total int                  `json:"total"`
	List  []*SimpleCompanyList `json:"list"`
}

type GetCompanyListReq struct {
	g.Meta `path:"/v1/companies" tags:"Company" method:"get" summary:"公司列表"`
}

type GetCompanyListRes struct {
	List []*SimpleCompanyList `json:"list"`
}

type EditCompanyReq struct {
	Title            string `json:"title" v:"required|length:2, 30"`
	Host             string `json:"host"  v:"length:2, 30"`
	Address          string `json:"address"  v:"length:2, 40"`
	Email            string `json:"email" v:"length:2, 20"`
	FinanceId        uint   `json:"financeId"`
	IndustryId       uint   `json:"industryId"`
	ClientDes        string `json:"clientDes" v:"max-length:200"`
	Culture          string `json:"culture" v:"max-length:200"`
	InterviewProcess string `json:"interviewProcess" v:"max-length:200"`
	PrivyDes         string `json:"privyDes"`
}

type CreateCompanyReq struct {
	g.Meta `path:"/company" tags:"Company" method:"post" summary:"公司"`
	EditCompanyReq
}
type CreateCompany1Req struct {
	g.Meta `path:"/company1" tags:"Company" method:"post" summary:"公司"`
	Title  string `json:"title" v:"required|length:2, 30"`
}
type CreateCompany1Res struct {
	*entity.Company
}

type ModifyCompanyReq struct {
	g.Meta `path:"/company/{Id}" tags:"Company" method:"put" summary:"公司"`
	Id     uint `json:"id" in:"path" v:"required"`
	EditCompanyReq
}

type DeleteCompanyReq struct {
	g.Meta `path:"/company/{Id}" tags:"Company" method:"delete" summary:"公司"`
	Id     uint `json:"id" in:"path" v:"required"`
}

type GetCompanyDetailReq struct {
	g.Meta `path:"/company/{Id}" tags:"Company" method:"get" summary:"公司"`
	Id     uint `json:"id" in:"path" v:"required"`
}

type GetCompanyDetailRes struct {
	entity.Company
}
